<page-header model="ctrl.navModel"></page-header>

<div class="page-container page-body">

  <h3 class="page-sub-heading" ng-hide="ctrl.isNew"><!--Edit Notification Channel-->编辑通知频道</h3>
  <h3 class="page-sub-heading" ng-show="ctrl.isNew"><!--New Notification Channel-->新建通知频道</h3>

  <form name="ctrl.theForm" ng-if="ctrl.notifiers">
    <div class="gf-form-group">
      <div class="gf-form">
        <span class="gf-form-label width-12"><!--Name-->名称</span>
        <input type="text" required class="gf-form-input max-width-15" ng-model="ctrl.model.name" required></input>
      </div>
      <div class="gf-form">
        <span class="gf-form-label width-12"><!--Type-->类型</span>
        <div class="gf-form-select-wrapper width-15">
          <select class="gf-form-input" ng-model="ctrl.model.type" ng-options="t.type as t.name for t in ctrl.notifiers" ng-change="ctrl.typeChanged(notification, $index)">
          </select>
        </div>
      </div>
      <gf-form-switch
          class="gf-form"
          label="所有告警都发通知"
          label-class="width-12"
          checked="ctrl.model.isDefault"
          tooltip="将此通知用于所有告警">
      </gf-form-switch>
      <gf-form-switch
          class="gf-form"
          label="包含图片"
          label-class="width-12"
          checked="ctrl.model.settings.uploadImage"
          tooltip="捕获图像并将其包含在通知中">
      </gf-form-switch>
    </div>

    <div class="gf-form-group" ng-include src="ctrl.notifierTemplateId">
    </div>

    <div class="gf-form-group gf-form-button-row">
			<button type="submit" ng-click="ctrl.save()" class="btn btn-success width-7"><!--Save-->保存</button>
			<button type="submit" ng-click="ctrl.testNotification()" class="btn btn-secondary width-7"><!--Send Test-->发送测试</button>
			<a href="alerting/notifications" class="btn btn-inverse"><!--Back-->返回</a>
    </div>
  </form>
</div>
